<template>
	<view class="p30">
		<view class="bg-fff radius20 p20 ">
			<view class="tit-ac fw-w flex mb20" style="margin-left: -20rpx;">
				<view class="">订单信息</view>
				<view class="flex1"></view>
			</view>
			<view class="flex">
				<view class="">
					<u-image width="136" height="136" :src="data.image||''" borderRadius="10" />
				</view>
				<view class="ml20 flex1 als-s flex-col row-between">
					<view class="flex ov-h w-max">
						<view class="flex1 fw-w fs30 line-1">{{data.service_name}}</view>
					</view>
					<view class="color-666 fs26" v-if="data.hospital">{{data.hospital}}</view>
					<view class="color-666 fs26" v-if="data.patient">
						<text class="">{{data.patient.name}}</text>
						{{data.patient.relation}}
						{{$list('sex',data.patient.sex)}}
						{{data.patient.age}}
					</view>
				</view>
			</view>
		</view>
		<view class="bg-fff radius20 p20 mt20" v-if="data.master">
			<view class="tit-ac fw-w flex mb20" style="margin-left: -20rpx;">
				<view class="">接单人信息</view>
				<view class="flex1"></view>
			</view>
			<master :item="data.master" :border="false" />
		</view>
		<view class="bg-fff radius20 p20 mt20 color-999 flex-col col-center">
			<view class="tit-ac fw-w flex mb20 w-max" style="margin-left: -20rpx;">
				<view class="color-333">评价</view>
				<view class="flex1"></view>
			</view>
			<view class="mt20 flex row-around w-max">
				<view class="" v-for="(item,index) in typeList" :key="index" @click="form.type=item">
					<evaluate-type :type="item" :checked="form.type==item" />
				</view>
			</view>
			<view class="bg-f8f p20 radius16 w-max mt20" style="border: 1rpx dashed #cfcfcf;">
				<u-input type="textarea" height="270" v-model="form.content" placeholder="请对陪诊师进行评价" :clearable="false">
				</u-input>
			</view>
			<view class="w-max mt20">
				<z-imgs up @success="form.images=$event" max="6" />
			</view>
		</view>
		<view class="h120"></view>
		<view class="pf bottom0 left0 bg-fff w-max">
			<view class="flex">
				<view class="flex1 p20">
					<u-button type="warning" ripple @click="submit">提交</u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				typeList: ['good', 'medium', 'bad'],
				form: { //good=好评，medium=中评，bad=差评
					type: 'good',
					content: '', //评价内容
					images: '', //上传照片（,号隔开）
				},
			};
		},
		onShow() {
			this.getData()
		},
		methods: {
			submit() {
				if (!this.form.content) return this.$msg('请对陪诊师进行评价')
				let params = {
					...this.$params,
					...this.form,
				}
				this.$request('/member/order/toComment ', params).then(res => {
					this.$msg(res.msg)
					this.$navBack(1, 1000)
				})
			},
			getData() { //订单数据
				this.$request('/member/order/orderInfo', this.$params).then(res => {
					this.data = res.data
				})
			},
		}
	}
</script>

<style lang="scss">

</style>